<?php


namespace app\validate;

use think\Validate;

class Check extends Validate
{
    protected $rule = [
        'token' => 'require',
        'user_id' => 'require',
        'version' => 'require',
        'lang' => 'require',

        'demand'=>'require',
        'goods_id'=>'require',
        'goods_list'=>'require',
        'transport_type'=>'require',
        'transport_way'=>'require',
        'vehicle_id'=>'require',
        'goods_num'=>'require',
        'delivery_at'=>'require',
        'tel'=>'require',
        'price'=>'require',
        'price_unit'=>'require',

        'area_id'=>'require',

        'title'=>'require',
        'goods_weight'=>'require',
        'goods_volume'=>'require',

        'delivery_id'=>'require',
        'user_ids'=>'require',



    ];

    protected $message = [
        'token.require' => 'token不能为空',
        'user_id.require' => '用户id不能为空',
        'version.require' => '版本号不能为空',
        'lang.require' => '语言类型不能为空',

        'demand.require' => '请选择需求',
        'goods_id.require' => '请选择货物',
        'goods_list.require' => '请上传货物清单',
        'transport_type.require' => '请选择运输方式',
        'transport_way.require' => '请选择运输类型',
        'vehicle_id.require' => '请选择载具',
        'goods_num.require' => '请填写数量',
        'delivery_at.require' => '请填写发货时间',
        'tel.require' => '请填写手机号',
        'price.require' => '请填写货物出价',
        'price_unit.require' => '请填写价格单位',

        'area_id.require' => '请选择地址',

        'title.require' => '请填写名称',
        'goods_weight.require' => '请填写重量',
        'goods_volume.require' => '请填写体积',

        'delivery_id.require' => '请上传发货id',
    ];

    protected $scene = [
        'check' => ['token', 'user_id', 'version', 'lang'],
        'delivery' => ['token', 'user_id', 'version', 'lang', 'goods_id', 'transport_type', 'transport_way', 'goods_num', 'delivery_at', 'tel'],
        'select_address'=>['token', 'user_id', 'version', 'lang','area_id'],
        'goods'=>['token', 'user_id', 'version', 'lang','title','goods_weight','goods_volume','goods_num'],
        'delivery_step' => ['token', 'user_id', 'version', 'lang', 'delivery_id'],

        'request_clearance' => ['token', 'user_id', 'version', 'lang'],
        'history_list' => ['token', 'user_id', 'version', 'lang'],
        'delivery_task' => ['token', 'user_id', 'version', 'lang', 'delivery_id', 'task_user_id'],

        'create_step' => ['token', 'user_id', 'version', 'lang', 'delivery_id'],

    ];
}